-
Notifications
You must be signed in to change notification settings - Fork 66
FXC-3603: security fixes in github actions as suggested by zizmor #2882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, 4 comments
94bc1d5
to
303c5eb
Compare
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changesNo lines with coverage information in this diff. |
I have renamed the title of this PR to link to the Zizmor jira task. Are we supposed to link multiple PRs to a single jira issue or should we create a new one everytime? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mahlau-flex this is great! Besides what was already commented LGTM. I'm not too familiar with the details but as long as everything keeps running it looks fine to me.
303c5eb
to
726ec9f
Compare
hm, it seems that some tests are actually failing here. It looks like these are the discussed windows test cases. I will investigate how to fix this |
Hi @mahlau-flex thanks! Could you share some github actions run links where you test each workflow bar the release one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @mahlau-flex this is a good cleanup. Let's just do some final checking on the workflow runs and then we can merge
Sorry, I am not sure what you mean by that. Is it possible to manually trigger the workflows as a test? Would this break anything? |
726ec9f
to
609d153
Compare
So yeah if you manually run all bar the release action from this branch it should be fine, it's just to check all works nicely now |
0fe4e27
to
f0971b9
Compare
7ff8f9d
to
92cd2cd
Compare
Everything should be working now. Here are links to the successfull manual runs:
The daily run fails, but I believe this has nothing to do with the changes here, but rather that the test is doing what its supposed to be doing and alerting that we need to update a submodule: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
92cd2cd
to
2555b7d
Compare
Fixed all (except one) of the many security vulnerabilities found by zizmor (12 informational, 0 low, 19 medium, 19 high). While I am pretty sure that the functionality remains the same, we will need to see (an carefully review) if something broke during these changes.
The one issue I could not change is the following (status informational):
I have suppressed the zizmor warning for now. In the long run it would probably be best to use the newer authentication of pypi releases (according to Claude, one can just register a github workflow in pypi instead of using the legacy token system).
Additionally, I have added a pre-commit check for zizmor as well. This might seem a bit excessive, but runs extremely quickly so I think it will not bother anyone.
Lastly, I changed the configuration of zizmor itself in the github actions. I noticed that in the last PR, the job completed successfully, even though it found a security issue. This is, because it uploads the results to github advanced security, which then makes a comment showing the issue. But, this does not prevent merging and is not clearly visibly. With the new system, the checks themselves should (hopefully) fail.
Greptile Overview
Updated On: 2025-10-09 19:03:13 UTC
Summary
This PR implements comprehensive security hardening for GitHub Actions workflows based on findings from the zizmor security scanner, which identified 50 security vulnerabilities (12 informational, 19 medium, 19 high) across the CI/CD pipeline. The changes follow GitHub Actions security best practices without altering functionality.Key security improvements include:
Permission Management: Moving from broad permissions to the principle of least privilege by setting global permissions to
contents: read
and granting specific permissions only where needed (e.g.,contents: write
for jobs that push changes)Action Security: Pinning action versions to specific commit SHAs instead of floating tags to prevent supply chain attacks where malicious code could be injected through compromised action updates
Credential Protection: Adding
persist-credentials: false
to checkout actions to prevent GitHub tokens from being accessible to subsequent workflow steps that don't need themScript Injection Prevention: Moving GitHub context expressions (like PR titles and branch names) to environment variables to prevent potential script injection attacks
Proactive Security: Adding zizmor as both a dependency in
pyproject.toml
and a pre-commit hook to catch future security issues during developmentThe changes span 8 workflow files covering testing, releases, documentation sync, and daily operations. One informational issue regarding PyPI trusted publishing was acknowledged but left unaddressed, with plans to migrate to the newer authentication system in the future. The implementation maintains all existing functionality while significantly reducing the attack surface of the CI/CD pipeline.
Important Files Changed
Changed Files
.github/workflows/tidy3d-python-client-tests.yml
.github/workflows/tidy3d-python-client-release.yml
.github/workflows/tidy3d-python-client-update-lockfile.yml
.github/workflows/tidy3d-python-client-daily.yml
.github/workflows/tidy3d-docs-sync-readthedocs-repo.yml
.github/workflows/tidy3d-python-client-submodules-test.yml
.github/workflows/tidy3d-python-client-develop-cli.yml
.pre-commit-config.yaml
pyproject.toml
Confidence score: 4/5
Sequence Diagram